// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_RO_ITEM
// * CreateDate    : 2014-06-05 18:30:38
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:38
// * LastChanger   : 2014-06-05 18:30:38
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class SalesRoItemEntity : EntityBase
    {
        public SalesRoItemTable TableSchema
        {
            get
            {
                return SalesRoItemTable.Current;
            }
		}
		
		public SalesRoItemEntity()
        {

        }
		
		public SalesRoItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.RoId = Convert.ToString(CommonFunctions.ToObject(dr["RO_ID"]));
			this.RoNo = Convert.ToString(CommonFunctions.ToObject(dr["RO_NO"]));
			this.SalesAppItemId = Convert.ToString(CommonFunctions.ToObject(dr["SALES_APP_ITEM_ID"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.DeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_DATE"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.ReturnQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["RETURN_QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.ActuralArvDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["ACTURAL_ARV_DATE"]));
			this.ActuralArvQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["ACTURAL_ARV_QTY"]));
			this.LocationNo = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_NO"]));
			this.IsFree = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_FREE"]));
        }
		
		public SalesRoItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.RoId = Convert.ToString(CommonFunctions.ToObject(dr["RO_ID"]));
			this.RoNo = Convert.ToString(CommonFunctions.ToObject(dr["RO_NO"]));
			this.SalesAppItemId = Convert.ToString(CommonFunctions.ToObject(dr["SALES_APP_ITEM_ID"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.DeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_DATE"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.ReturnQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["RETURN_QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.ActuralArvDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["ACTURAL_ARV_DATE"]));
			this.ActuralArvQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["ACTURAL_ARV_QTY"]));
			this.LocationNo = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_NO"]));
			this.IsFree = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_FREE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SalesRoItemTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_ID)); }
            set { SetData(SalesRoItemTable.C_ID, value); }
        }
		
        [DataMember]
        public string RoId
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_RO_ID)); }
            set { SetData(SalesRoItemTable.C_RO_ID, value); }
        }
		
        [DataMember]
        public string RoNo
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_RO_NO)); }
            set { SetData(SalesRoItemTable.C_RO_NO, value); }
        }
		
        [DataMember]
        public string SalesAppItemId
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_SALES_APP_ITEM_ID)); }
            set { SetData(SalesRoItemTable.C_SALES_APP_ITEM_ID, value); }
        }
		
        [DataMember]
        public string MaterialId
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_MATERIAL_ID)); }
            set { SetData(SalesRoItemTable.C_MATERIAL_ID, value); }
        }
		
        [DataMember]
        public string MaterialName
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_MATERIAL_NAME)); }
            set { SetData(SalesRoItemTable.C_MATERIAL_NAME, value); }
        }
		
        [DataMember]
        public string MaterialCode
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_MATERIAL_CODE)); }
            set { SetData(SalesRoItemTable.C_MATERIAL_CODE, value); }
        }
		
        [DataMember]
        public DateTime DeliveryDate
        {
            get { return Convert.ToDateTime(GetData(SalesRoItemTable.C_DELIVERY_DATE)); }
            set { SetData(SalesRoItemTable.C_DELIVERY_DATE, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(SalesRoItemTable.C_QTY)); }
            set { SetData(SalesRoItemTable.C_QTY, value); }
        }
		
        [DataMember]
        public decimal ReturnQty
        {
            get { return Convert.ToDecimal(GetData(SalesRoItemTable.C_RETURN_QTY)); }
            set { SetData(SalesRoItemTable.C_RETURN_QTY, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_UNIT)); }
            set { SetData(SalesRoItemTable.C_UNIT, value); }
        }
		
        [DataMember]
        public decimal Price
        {
            get { return Convert.ToDecimal(GetData(SalesRoItemTable.C_PRICE)); }
            set { SetData(SalesRoItemTable.C_PRICE, value); }
        }
		
        [DataMember]
        public decimal SubTotal
        {
            get { return Convert.ToDecimal(GetData(SalesRoItemTable.C_SUB_TOTAL)); }
            set { SetData(SalesRoItemTable.C_SUB_TOTAL, value); }
        }
		
        [DataMember]
        public DateTime ActuralArvDate
        {
            get { return Convert.ToDateTime(GetData(SalesRoItemTable.C_ACTURAL_ARV_DATE)); }
            set { SetData(SalesRoItemTable.C_ACTURAL_ARV_DATE, value); }
        }
		
        [DataMember]
        public decimal ActuralArvQty
        {
            get { return Convert.ToDecimal(GetData(SalesRoItemTable.C_ACTURAL_ARV_QTY)); }
            set { SetData(SalesRoItemTable.C_ACTURAL_ARV_QTY, value); }
        }
		
        [DataMember]
        public string LocationNo
        {
            get { return Convert.ToString(GetData(SalesRoItemTable.C_LOCATION_NO)); }
            set { SetData(SalesRoItemTable.C_LOCATION_NO, value); }
        }
		
        [DataMember]
        public int IsFree
        {
            get { return Convert.ToInt32(GetData(SalesRoItemTable.C_IS_FREE)); }
            set { SetData(SalesRoItemTable.C_IS_FREE, value); }
        }
		
		#endregion
	}
	
	
}	

